package Test_0520;

/**
 * Created with Intellij IDEA
 * Description:
 * User: 星辰
 * Dare: 2024-05-21
 * Time: 23:36
 */
public class test1 {

        public static void main15(String[] args) {
            int a=10;
            byte b=2;
            //大范围转为小范围
            b=(byte)a;//int->byte
            System.out.println(b);//10
            short d=4;
            d=(short)a;//int->short
            System.out.println(d);//10
            long c=12;
            a=(int)c;//long->int
            System.out.println(a);//12
            double g=12.5;
            float h=11.2f;
            h=(float)g;//double->float
            System.out.println(h);//12.5
            //小范围转为大范围
            g=h;//float->double
            a=b;//byte->int
            System.out.println(g);//12.5
            System.out.println(a);//10
            g=(double)h;//float->double
            a=(int)b;//byte->int
            System.out.println(g);//12.5
            System.out.println(a);//10
        }
        public static void main14(String[] args) {
            int a=1;
            short d=1;
            double b=1;
            float c=3.14f;
            a=d;
            System.out.println(a);//1
            b=c;
            System.out.println(b);//3.140000104904175
        }
        public static void main13(String[] args) {
            boolean a=true;
            boolean b=false;
            System.out.println(a);//true
            System.out.println(b);//false
        }
        public static void main12(String[] args) {
            //字符型范围
            System.out.println((int)Character.MIN_VALUE);//最小值：0
            System.out.println((int)Character.MAX_VALUE);//最大值：65535
        }
        public static void main11(String[] args) {
            char a='1';
            char b='a';
            char c='啊';
            System.out.println(a);
            System.out.println(b);
            System.out.println(c);

        }
        public static void main10(String[] args) {
            double a=1;
            double b=20;
            System.out.println(a/b);//0.05
            double c=1.0;
            double d=20.0;
            System.out.println(c/d);//0.05
            double f=1.1;
            System.out.println(f*f);//1.2100000000000002
        }
        public static void main(String[] args) {
            double v=1.0D;
            double a=0;
            double b=1.0;
            double c=0.1;
            double d=0.00000001;
            double f=0.1234567;
            double h=0.1d;
            double k=0.00000;
            double l=1.00000;
            System.out.println(v);
            System.out.println(a);//0.0
            System.out.println(b);//1.0
            System.out.println(c);//0.1
            System.out.println(d);//1.0E-8
            System.out.println(f);//0.1234567
            System.out.println(h);//0.1
            System.out.println(k);//0.0
            System.out.println(l);//1.0
            //双精度浮点型范围
            System.out.println(Double.MIN_VALUE);//最小值：1.4E-45
            System.out.println(Double.MAX_VALUE);//最大值：3.4028235E38
        }
        public static void main8(String[] args) {
            float l=1F;
            float a=1f;
            float b=0.1f;
            float f=0.001f;
            float d=0.0001f;
            float s=0.00000123f;
            float h=0.12345f;
            float g=0.123456789f;
            float k=1.00000f;
            System.out.println(l
            );
            System.out.println(a);//1.0
            System.out.println(b);//0.1
            System.out.println(f);//0.001
            System.out.println(d);//1.0E-4
            System.out.println(s);//1.23E-6
            System.out.println(h);//0.12345
            System.out.println(g);//0.12345679
            System.out.println(k);//1.0
            //单精度浮点型范围
            System.out.println(Float.MIN_VALUE);//最小值：1.4E-45
            System.out.println(Float.MAX_VALUE);//最大值：3.4028235E38
        }
        public static void main7(String[] args) {
            byte a=1;
            //字节型范围
            System.out.println(Byte.MIN_VALUE);//最小值：-128
            System.out.println(Byte.MAX_VALUE);//最大值： 127
        }
        public static void main6(String[] args) {
            short a=1;
            //短整型范围：
            System.out.println(Short.MIN_VALUE);//最大值：-32768
            System.out.println(Short.MAX_VALUE);//最小值：32767
        }
        public static void main5(String[] args) {
            long a=10;
            //为了区分int和long,一般建议在long类型变量的初始值后面加上L或者l，最后是L，l与1相似
            long b=10l;
            long c=10L;
            //长整型范围
            System.out.println(Long.MIN_VALUE);//最大值：-9223372036854775808
            System.out.println(Long.MAX_VALUE);//最大值：9223372036854775807
        }
        public static void main4(String[] args) {
            int c=10;
            System.out.println(c);
            System.out.println(Integer.MIN_VALUE);
            System.out.println(Integer.MAX_VALUE);
        }
        public static void main3(String[] args) {
            //1.定义时初始化
            int a=10;
            System.out.println(a);
            //2.定义后初始化
            int b;
            b=100;
            System.out.println(b);

        }
        public static void main2(String[] args) {
            int a=10;
            System.out.println(a);//a=10
            a=100;
            System.out.println(a);//a=100
        }
        public static void main1(String[] args) {
            System.out.println("abc");//字符串常量
            System.out.println(123);//整形常量
            System.out.println(1.12);//浮点数常量
            System.out.println('a');//字符常量
            System.out.println(true);//布尔常量
        }


}
